package cn.imu.appdevexperiment2020._3activity;

import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import cn.imu.appdevexperiment2020.R;

/**
 * 描述:
 *
 * @author chenconghua
 * @create 2022-11-13 13:25
 * @version 1.0
 */
public class NewsContentFragment extends Fragment {

   private View view;

   @Nullable
   @Override
   public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      view = inflater.inflate(R.layout.news_content_frag,container,false);
      return view;
   }


   public void refresh(String newsTitle,String newsContent){
//      Log.e("cch1",newsTitle);
      View visibilityLayout = view.findViewById(R.id.visibility_layout);
      visibilityLayout.setVisibility(View.VISIBLE);
      TextView newsTitleText = view.findViewById(R.id.news_title);
      TextView newsContentText = view.findViewById(R.id.news_content);
      newsTitleText.setText(newsTitle);
      newsContentText.setText(newsContent);
   }
}
